#include "StdAfx.h"
#include "SplineEditor.h"
#include "SplineBuilder.h"
#include "FunctionDriverSpline.h"
REGISTERE_EDITOR(CSplineEditor);

CSplineEditor::CSplineEditor(void)
{
}

CSplineEditor::~CSplineEditor(void)
{
}
CString CSplineEditor::GetID(void)
{
	return SPLINE_CUID;
}

void CSplineEditor::Initialize(CAnyView* pView)
{
	CModelEditorEx::Initialize(pView);
}
bool CSplineEditor::CreatePreviewShape()
{
	m_Info.hPoints = GetPointArrary();

	TopoDS_Shape shape;
	CSplineBuilder builder;
	if(builder.Build(&m_Info, shape))
	{
		SetPreviewShape(shape);
		return true;
	}

	return false;
}

bool CSplineEditor::CreateShapeLabel(TDF_Label& label)
{
	label = NewLabel(_T("Spline"));

	m_Info.AddToLabel(label);

	Handle(CFunctionDriverSpline) functionDriver;
	return ProcessFunctionDriver<CFunctionDriverSpline>(label, functionDriver);
}

